<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <h:head>
        <title>RetailShop</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <link rel="stylesheet" type="text/css" href="recursos/css/main.css"/>
        <link rel="stylesheet" type="text/css" href="recursos/css/index.css"/>
        <script src="recursos/js/sha1-min.js" type="text/javascript"></script>
    </h:head>
    <h:body>

 



        <h:outputText id="logo" value="RetailShop"/>
        <h:form>
            <p:commandButton value="BOTON DEBUG NO PULSAR" ajax="false" action="#{startupBean.executeCategories}"/>
        </h:form>






        <div id="signup">
            <f:view>
                <h:form>  
                    <p:commandButton id="btnSignup" value="Registrarse" action="#{signupBean.goToSignup}"/>
                    <p:commandButton id="btnContinue" value="Continuar de todos modos" action="#{loginManagedBean.notRegistred}" style="opacity: 0.7" />          

                </h:form>
            </f:view>

        </div>
       
        <div id="login">
           
            <h:form >

                <h:form id="formLogin">  

                    <p:panel id="panelLogin" header="Login" >  

                        <p:messages id="msgsLogin" />  

                        <h:panelGrid columns="3" >  

                            <h:outputLabel for="email" value="Introduzca su email: "  />  
                            <p:inputText id="email" value="#{loginManagedBean.user.email}" size="30" validatorMessage="Debe ser un email válido"  maxlength="255" label="Email" required="true" >  
                                <p:watermark for="email" value="Ex: usuario@dominio.com"/>
                                <f:validateRegex pattern="^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$" />
                                <p:ajax update="msgEmail" event="keyup" />
                            </p:inputText>  
                            <p:message for="email" id="msgEmail" display="icon"/>  




                            <h:outputLabel for="password" value="Y su contraseña: " />  
                            <p:password  id="password" value="#{loginManagedBean.user.pass}" size="30" maxlength="15"  label="Password" required="true" > 
                                <p:watermark for="password" value="Contraseña"/>
                                <f:validateLength minimum="6" />  
                               <p:ajax update="msgPassword" event="keyup" />
                            </p:password>
                            <p:message for="password" id="msgPassword" display="icon" />  

                        </h:panelGrid>  
                        <p:spacer width="60" height="10" />
                        <p:commandButton id="btnLogin" value="Login" update="panelLogin" action="#{loginManagedBean.registred}" />  

                    </p:panel>  

                </h:form>  



            </h:form>




        </div>



    </h:body>
</html>

